<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>uKernel: port.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">uKernel
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">port.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="port_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef __PORT_H__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define __PORT_H__</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="types_8h.html">types.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="lpc17xx_8h.html" title="CMSIS Cortex-M3 Core Peripheral Access Layer Header File for NXP LPC17xx Device Series.">lpc17xx.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="kern__conf_8h.html">kern_conf.h</a>&quot;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 
<a name="l00009"></a><a class="code" href="port_8h.html#aba0b421654a6879f2caf2233cf23e9ab">00009</a> <span class="preprocessor">#define STACK_GROWTH 1  // 1 if stack grows from High to Low memory</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a><a class="code" href="port_8h.html#af9c081784a43ee4a89353f991dca4626">00011</a> <span class="preprocessor">#define SWITCH_CONTEXT() {SCB-&gt;ICSR |= 1 &lt;&lt; 28;}</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <a class="code" href="types_8h.html#a701b7c820e8a0f5fcb04e4cd838b6f17">OSStackType</a> *<a class="code" href="port_8c.html#a1198faaecdb84f9e87845dea672a37b2" title=": Initialize the stack of a newly created task.">StkInit</a>(<a class="code" href="types_8h.html#a701b7c820e8a0f5fcb04e4cd838b6f17">OSStackType</a> *tos, <a class="code" href="types_8h.html#a7ff77ba9f298c57ee621b35c801a25cd">task</a> <span class="keyword">function</span>, <span class="keywordtype">void</span> *args, <a class="code" href="types_8h.html#a701b7c820e8a0f5fcb04e4cd838b6f17">OSStackType</a> stack_size);
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="keywordtype">void</span> <a class="code" href="port_8h.html#a685f72aa18e0581ba0306eb0fd68eaf3">swap</a>(<span class="keywordtype">void</span>);
<a name="l00021"></a>00021 <span class="keywordtype">void</span> <a class="code" href="port_8h.html#a017dc188a5879551ed75a9e684a86039">context_switch</a>(<span class="keywordtype">void</span>);
<a name="l00022"></a>00022 <span class="keywordtype">void</span> <a class="code" href="port_8h.html#a66be906aade5538fe2e96bec388f90ce">init_service</a>(<span class="keywordtype">void</span>);
<a name="l00023"></a>00023 <a class="code" href="port__types_8h.html#a64e458b61bddf0b87a3701578aa7a428">uint_32</a> <a class="code" href="port_8c.html#a04b35503187113490268d89b18d82191">OSTickConfig</a>(<span class="keywordtype">void</span>);
<a name="l00024"></a>00024 <span class="keywordtype">void</span> <a class="code" href="port_8c.html#a1551a033c36f4d9fed64256320ad1e3e">OSTickStart</a>(<span class="keywordtype">void</span>);
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#if HIGHEST_PRIO_ALT == 3</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#if MAX_TASKS &gt; 32 </span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#error &quot;Number of tasks is too damn high for using port specific FindHighestPriorityTask.\</span>
<a name="l00030"></a>00030 <span class="preprocessor">                Either use less tasks or change HIGHEST_PRIO_ALT in kern_conf.h&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00032"></a><a class="code" href="port_8h.html#a5c295a85cd2f272dde9c67914ecf7799">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define FindHighestPriorityTask()       {highestTCB = ReadyArray[31 - __clz(ReadyTaskBitmap[0])];}</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="comment">// system calls declarations here</span>
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="keywordtype">void</span> <a class="code" href="port_8h.html#af232d387802b719ba09ad5c9d9123999">__svc</a>(0x23) start_os(<span class="keywordtype">void</span>);
<a name="l00038"></a>00038 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="port_8c.html#a0af7232f7a8c719d4eb2f14796141a00">prvGetRegistersFromStack</a>( uint32_t *pulFaultStackAddress );
<a name="l00040"></a>00040 <span class="preprocessor">#endif</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Sun Oct 13 2013 02:33:11 for uKernel by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
